Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Ftrack subprocess handle of stdout/stderr #1675

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jun 9, 2021

Issue

Ftrack user event server is running as subprocess which cause issues with logging because all python subprocess.Popen objects have stdout and stderr which are inherited from source process, but if openpype_gui executable is used then sys.stdout and sys.stderr are set to None so new created processes get strange PIPE objects that can't work with PypeStreamHandler properly and may crash at any time because flush of the stream cause OSError.

Changes

  • redirect stdout of ftrack process to devnull if sys.stdout is None to prevent issues described above

Why is that important

Any processed action can crash during logging (most visible when launchin application).

How to replicate issue

Hard to say. I launched Nuke 5-10 timer in row from ftrack. One of launches should crash if openpype_gui executable is used.

Closes: https://github.com/pypeclub/client/issues/92

@iLLiCiTiT iLLiCiTiT self-assigned this Jun 9, 2021
@iLLiCiTiT iLLiCiTiT added backend type: bug Something isn't working labels Jun 9, 2021
Copy link
Member

@64qam 64qam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I launched Nuke and TVP more than 20 times without any error.

@jakubjezek001
Copy link
Member

have tried it on develop branch 15x open nuke and nothing happened..

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code is not breaking anything so it is ready to merge.

@iLLiCiTiT iLLiCiTiT merged commit fbe01ab into develop Jun 11, 2021
@mkolar mkolar deleted the bugfix/redirect_stdout_from_gui_executable branch August 10, 2021 16:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants